<?php
// View script for action signup
/* @var $this View */
?>
<div class="row">
    <div class="span6 offset3">
        <div class="login">
            <h2><?php echo __('Đăng ký'); ?></h2>
            <?php
            $captchaUrl = $this->Html->url(array('action' => 'captchaImage'));
            $captchaImage = $this->Html->image($captchaUrl, array('id' => 'captcha'));
            $captchaButton = $this->Html->image('ico-refresh.png', array(
                'url' => 'javascript:void(0);',
                'onClick' => 'javascript:document.images.captcha.src="' . $captchaUrl . '?" + Math.round(Math.random(0)*1000)+1'
                    ));
            echo $this->Form->create('User', array('onSubmit' => 'return checkform(this)'));
            echo $this->Form->input('email', array());
            echo $this->Form->input('password', array('label' => __('Mật khẩu')));
            echo $this->Form->input('repassword', array('label' => __('Nhập lại mật khẩu'), 'type' => 'password'));
            echo $this->Form->input('captcha', array(
                'label' => __('Nhập các ký tự bên phải vào trong ô'),
                'div' => 'input text required captcha',
                'after' => $captchaImage . $captchaButton
            ));
            echo $this->Form->submit(__('Đăng ký'));
            echo $this->Form->end();
            ?>
        </div>
    </div>
</div>
<script type="text/javascript">
    function checkform(form){
        //TODO : viết form check input từ phía client
        return true;
    }
</script>